/**
 * Copyright (C) 2008+ Saifeng Zeng
 *		 2008+ Spark Zheng
 *
 * @file	src/bit.c
 * @brief 
 *      Bit module, A basic datastruct module.
 *      Memory-free operations, bit-vectors datastruct and atomic algorithms
 *      -1. bit vector
 *      -2. atomic
 *
 * @module      dlib
 * @see	 dlib
 *
 * @history     
 *	      version 0.1.0, Saifeng Zeng initialized.
 *	      version 0.1.2, Spark add dlib_show_bytes(like in cs:app)
 *	      version 0.3.0, Spark add atomic operations.
 */

#include <stdio.h>
#include "bit.h"

/** misc functions */
inline void dlib_show_bytes(void *arg, uint32_t len)
{
	if (arg == NULL)
		return;

	uint32_t i;
	uint8_t *start = (uint8_t *) arg;

	for (i = 0; i < len; i++) {
		fprintf(stdout, " %.2x", start[i]);
	}
	fprintf(stdout, "\n");

	return;
}

